<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('系统管理员操作界面')"/>
    <th:block th:include="include :: summernote-css"/>
    <th:block th:include="include :: bootstrap-select-css"/>
</head>
<style type="text/css">
    table {
        table-layout:fixed;
    }
    table td{
        overflow: hidden;
        text-overflow:ellipsis;
        white-space: nowrap;
    }
    table td:hover {
        overflow: auto;
        white-space: pre-wrap;
    }
</style>
<script type="text/javascript">
    //点击编辑按钮弹出模态框的回显。
    function EditViewById(row, index) {
        $('.edittosummernote').summernote('destroy');
        var data = JSON.stringify($("#bootstrap-table").bootstrapTable('getData')); //获取全部数据
        var data_json = JSON.parse(data); //data_json和data_json2一样都是json对象
        var data_json2 = eval("(" + data + ")");
        //由于data2已经是对象了，alert不能显示对象只能显示为[object Object],需要控制台打印
        //根据index找到对应行数据，填充数据到修改模态框
        $("#id_update_static_15").val(data_json[index].id);
        $("#mkmc_update_input_15").val(data_json[index].mkmc);
        $("#went_update_input_15").val(data_json[index].went);
        $("#yuany_update_input_15").val(data_json[index].yuany);
        // $("#jjbz_update_input_15").val(data_json[index].jjbz);

        $('.edittosummernote').html($(".edittosummernote").val(data_json[index].jjbz).val());
        $('.edittosummernote').summernote({
            focus: true,
            height:200
        });
        $("#emp_update_btn").val(data_json[index].id);
        //弹出修改模态框，非新增模态框
        $('#myModal5').modal('show')
    };

    //查看
    function ViewById(index) {
        var data = JSON.stringify($("#bootstrap-table").bootstrapTable('getData')); //获取全部数据
        var data_json = JSON.parse(data); //data_json和data_json2一样都是json对象
        var data_json2 = eval("(" + data + ")");
        //由于data2已经是对象了，alert不能显示对象只能显示为[object Object],需要控制台打印
        //根据index找到对应行数据，填充数据到修改模态框
        $("#id_update_static_16").val(data_json[index].id);
        $("#mkmc_update_input_16").val(data_json[index].mkmc);
        $("#went_update_input_16").val(data_json[index].went);
        $("#yuany_update_input_16").val(data_json[index].yuany);
        // $("#jjbz_update_input_16").val(data_json[index].jjbz);
        $('.clicktosummernote').html($(".clicktosummernote").val(data_json[index].jjbz).val());
        $('.clicktosummernote').summernote('destroy');
        //弹出修改模态框，非新增模态框
        $('#myModal6').modal('show');
    };

    // 更新完成
    function updatespkfk(obj) {
        var wtid = obj.getAttribute("value");
        var jjbz = $('.edittosummernote').summernote('code');
        $("#jjbz_update_input_15").val(jjbz);
        $.ajax({
            url: "/nc/sysNc/editspkfk/" + wtid,
            type: 'PUT',
            data: $("#myModal5 form").serialize(),
            success: function (result) {
                if (result != null) {
                    alert("更新成功！！！");
                    $("#myModal5").modal('hide');
                    window.location.href = window.location.href;
                }
            }
        });
    };

    function DeleteByIds(index) {
        var data = JSON.stringify($("#bootstrap-table").bootstrapTable('getData')); //获取全部数据
        var data_json = JSON.parse(data); //data_json和data_json2一样都是json对象
        var data_json2 = eval("(" + data + ")");
        //由于data2已经是对象了，alert不能显示对象只能显示为[object Object],需要控制台打印
        //根据index找到对应行数据，填充数据到修改模态框
        var id = data_json[index].id;
        var went = data_json[index].went;
        if (confirm("确认删除【" + went + "】吗？")) {
            $.ajax({
                url: "/nc/sysNc/deletespkfk/" + id,
                type: 'delete',
                success: function (result) {
                    if (result != null) {
                        alert("删除成功！！！");
                        window.location.href = window.location.href;
                    }
                },
            });
        }
    };

    function gettjmtk() {
        $("#empAddModal").modal({
            backdrop: "static"
        });
    };

    // 添加成功
    function savespkfk() {
        var jjbz = $('.summernote').summernote('code');
        $("#jjbz").val(jjbz);
        var wentnonull=document.getElementById("wentnonull");
        var yuanynotnull=document.getElementById("yuanynotnull");
        var beiznotnull=document.getElementById("beiznotnull");
        var guanjznotnull1=document.getElementById("guanjznotnull1");
        var guanjznotnull2=document.getElementById("guanjznotnull2");
        var guanjznotnull3=document.getElementById("guanjznotnull3");
        if (wentnonull.value.length<2){
            wentnonull.focus();
            return false;
        }
        if (yuanynotnull.value.length<2){
            yuanynotnull.focus();
            return false;
        }
        if (beiznotnull.value.length<2){
            beiznotnull.focus();
            return false;
        }
        if (guanjznotnull1.value.length<2){
            wentnonull.focus();
            return false;
        }
        if (guanjznotnull2.value.length<2){
            guanjznotnull2.focus();
            return false;
        }
        if (guanjznotnull3.value.length<2){
            guanjznotnull3.focus();
            return false;
        }
        $.ajax({
            url: "/nc/sysNc/insertspkfk",
            type: 'POST',
            data: $("#empAddModal form").serialize(),
            success: function (result) {
                if (result != null) {
                    alert("添加成功！！！");
                    $("#empAddModal").modal('hide');
                    $('.summernote').summernote('destroy');
                    window.location.href = window.location.href;
                }
            }
        });
    };
</script>
<body class="gray-bg" style="height: auto">
<!--添加模态框开始-->
<div class="modal fade" id="empAddModal" tabindex="-1" role="dialog" aria-hidden="true"
     data-keyboard="false">
    <div class="modal-dialog modal-lg" style="width: 935px">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span>
                </button>
                <h4 class="modal-title">添加问题模块</h4>
            </div>
            <div class="modal-body">
                <form id="form-user-add" class="form-horizontal">
                    <div class="row">
                        <div class="form-group" style="margin: 5px auto">
                            <label class="col-sm-2 control-label" style="margin-left: -20px"><span style="color: red;">*</span>问题名称</label>
                            <div class="col-sm-10" style="margin-left: -20px">
                                <input name="went" placeholder="请输入问题名称" id="wentnonull" class="form-control"
                                       type="text"  minlength="2" required>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group" style="margin: 5px auto">
                            <label class="col-sm-2 control-label" style="margin-left: -20px"><span style="color: red; ">*</span>问题原因</label>
                            <div class="col-sm-10" style="margin-left: -20px">
                                <input name="yuany" id="yuanynotnull" class="form-control" type="text" minlength="2" required
                                       placeholder="请输入问题原因">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-4" style="margin: 5px auto">
                            <div class="form-group">
                                <label class="col-sm-6 control-label" style="margin-left: -20px"><span style="color: red; ">*</span>是否热点</label>
                                <div class="col-sm-6" style="margin-left: -20px">
                                    <label class="toggle-switch switch-solid">
                                        <input type="checkbox" id="isRd" name="isRd" value=1 >
                                        <span></span>
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-8">
                            <div class="form-group" style="margin-top: 5px;margin-left: -100px ">
                                <label class="col-sm-4 control-label" style="margin-left: -20px"><span style="color: red; ">*</span>模块名称</label>
                                <div class="col-sm-8">
                                    <div class="input-group">
                                        <!--<input name="mkmc" type="text" placeholder="请选择模块名称" class="form-control">-->
                                        <div class="input-group" style="width: 428px;">
                                            <select name="mkid" class="form-control m-b" style="margin-left: -20px">
                                                <!--<option th:value="" th:text="请选择"></option>-->
                                                <option id="mkmcnotnull" th:each="sysmcs : ${sysmcs}"
                                                        th:value="${sysmcs.mkid} "
                                                        th:text="${sysmcs.mkmc}"></option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-4" style="margin: -12px auto">
                            <div class="form-group">
                                <label class="col-sm-6 control-label" style="margin-left: -20px"><span style="color: red; ">*</span>是否技术</label>
                                <div class="col-sm-6" style="margin-left: -20px">
                                    <label class="toggle-switch switch-solid">
                                        <input type="checkbox" id="isJs" name="isJs" value=1>
                                        <span></span>
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-8" style="margin: -12px auto">
                            <div class="form-group" style="margin-top: 5px;margin-left: -100px ">
                                <label class="col-sm-4 control-label" style="margin-left: -20px"><span style="color: red; ">*</span>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</label>
                                <div class="col-sm-8" style="margin-left: -20px">
                                    <input name="beiz" id="beiznotnull" placeholder="请输入备注" class="form-control" minlength="2" required
                                           type="text">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-4" style="margin-top: 5px">
                            <div class="form-group">
                                <label class="col-sm-4 control-label" style="margin-left: 20px"><span style="color: red; ">*</span>关键字1</label>
                                <div class="col-sm-8" style="margin-left: -20px">
                                    <input name="guanjz" id="guanjznotnull1" placeholder="请输入关键字1" class="form-control" minlength="2" required
                                           type="text">
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <div class="form-group" style="margin-top: 5px">
                                <label class="col-sm-4 control-label" style="margin-left: 0px"><span style="color: red; ">*</span>关键字2</label>
                                <div class="col-sm-8" style="margin-left: -20px">
                                    <input name="guanjz" id="guanjznotnull2" placeholder="请输入关键字2" class="form-control" minlength="2" required
                                           type="text">
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <div class="form-group" style="margin-top: 5px">
                                <label class="col-sm-4 control-label" style="margin-left: -20px"><span style="color: red; ">*</span>关键字3</label>
                                <div class="col-sm-8" style="margin-left: -20px">
                                    <input name="guanjz" id="guanjznotnull3" placeholder="请输入关键字3" class="form-control" minlength="2" required
                                           type="text">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row" >
                        <div class="col-sm-12" style="margin-top: -15px">
                        <div class="form-group" >
                            <label class="col-sm-2 control-label" style="margin-left: -20px"><span style="color: red; ">*</span>解决步骤</label>
                        </div></div>
                        <div class="col-sm-12" style="margin-top: -12px">
                        <div class="form-group" style="margin: 2px auto">
                                <!--<div class="ibox float-e-margins">-->
                                <!--<div class="ibox-title">-->
                                <!--<h5>Summernote 富文本编辑器</h5>-->
                                <!--</div>-->
                                <div class="ibox-content no-padding" style="margin-left: 40px;margin-right: 40px ">
                                    <div class="summernote">
                                    </div>
                                    <input name="jjbz" id="jjbz" class="form-control" type="hidden">
                                </div>
                                <!--</div>-->
                            </div>
                        </div>
                        </div>
                </form>
            </div>
            <div class="modal-footer" style="margin-top: -30px">
                <button type="button" class="btn btn-white" data-dismiss="modal" style="margin-top: -5px">关闭</button>
                <button type="button" class="btn btn-white" id="emp_save_btn" onclick="savespkfk()"
                        style="margin-top: -5px">保存
                </button>
            </div>
        </div>
    </div>
</div>
<!--添加模态框结束-->

<!--查看模态框开始-->
<div class="modal inmodal fade" id="myModal6" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static"
     data-keyboard="false">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span>
                </button>
                <h4 class="modal-title">窗口标题</h4>
                <small class="font-bold">这里可以显示副标题。</small>
            </div>
            <div class="modal-body">
                <!--<p><strong>RuoYi</strong>是一个完全响应式，基于Bootstrap3.3.6最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术，她提供了诸多的强大的可以重新组合的UI组件，并集成了最新的jQuery版本(v2.1.1)，当然，也集成了很多功能强大，用途广泛的jQuery插件，她可以用于所有的Web应用程序，如网站管理后台，网站会员中心，CMS，CRM，OA等等，当然，您也可以对她进行深度定制，以做出更强系统。</p>-->
                <form class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">问题序号</label>
                        <div class="col-sm-10">
                            <input type="text" disabled name="id" class="form-control" id="id_update_static_16">
                            <span class="help-block"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">模块名称</label>
                        <div class="col-sm-10">
                            <input type="text" disabled name="mkmc" class="form-control" id="mkmc_update_input_16">
                            <span class="help-block"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">问题名称</label>
                        <div class="col-sm-10">
                            <input type="text" disabled name="went" class="form-control" id="went_update_input_16">
                            <span class="help-block"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">问题原因</label>
                        <div class="col-sm-10">
                            <input type="text" disabled name="yuany" class="form-control" id="yuany_update_input_16">
                            <span class="help-block"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">解决办法</label>
                        <div class="col-sm-10">
                            <div class="clicktosummernote"></div>
                            <span class="help-block"></span>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>
<!--查看模态框结束-->

<!--编辑模态框开始-->
<div class="modal inmodal fade" id="myModal5" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static"
     data-keyboard="false">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span>
                </button>
                <h4 class="modal-title">窗口标题</h4>
                <small class="font-bold">这里可以显示副标题。</small>
            </div>
            <div class="modal-body">
                <!--<p><strong>RuoYi</strong>是一个完全响应式，基于Bootstrap3.3.6最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术，她提供了诸多的强大的可以重新组合的UI组件，并集成了最新的jQuery版本(v2.1.1)，当然，也集成了很多功能强大，用途广泛的jQuery插件，她可以用于所有的Web应用程序，如网站管理后台，网站会员中心，CMS，CRM，OA等等，当然，您也可以对她进行深度定制，以做出更强系统。</p>-->
                <form class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">问题序号</label>
                        <div class="col-sm-10">
                            <input type="text" name="id" class="form-control" id="id_update_static_15">
                            <span class="help-block"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">模块名称</label>
                        <div class="col-sm-10">
                            <input type="text" name="mkmc" class="form-control" id="mkmc_update_input_15">
                            <span class="help-block"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">问题名称</label>
                        <div class="col-sm-10">
                            <input type="text" name="went" class="form-control" id="went_update_input_15">
                            <span class="help-block"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">问题原因</label>
                        <div class="col-sm-10">
                            <input type="text" name="yuany" class="form-control" id="yuany_update_input_15">
                            <span class="help-block"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">解决办法</label>
                        <div class="col-sm-10">
                            <div class="edittosummernote"></div>
                            <input type="hidden" name="jjbz" class="form-control" id="jjbz_update_input_15">
                            <span class="help-block"></span>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-white" id="emp_update_btn" onclick="updatespkfk(this)">更新</button>
            </div>
        </div>
    </div>
</div>
<!--编辑模态框结束-->
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="operlog-form">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>问题名称：</label><input type="text" name="went" id="went"/>
                        </li>
                        <li class="select-selectpicker">
                            <label>模块名称：</label><select id="mkid" class="selectpicker" data-none-selected-text="请选择"
                                                        multiple>
                            <option th:each="sysmcs : ${sysmcs}" th:value="${sysmcs.mkid} "
                                    th:text="${sysmcs.mkmc}"></option>
                        </select>
                        </li>
                        <li>
                            <label>是否技术问题：</label><select name="status">
                            <option value="">所有</option>
                            <option value="是">是</option>
                            <option value="否">否</option>
                        </select>
                        </li>
                        <!--<li class="select-time">-->
                        <!--<label>操作时间： </label>-->
                        <!--<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>-->
                        <!--<span>-</span>-->
                        <!--<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>-->
                        <!--</li>-->
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" id="search_btn"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="gettjmtk()">
                <i class="fa fa-pencil"></i> 添加
            </a>
            <a class="btn btn-danger" onclick="remove()" id="remove">
                <i class="fa fa-remove"></i> 删除
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: summernote-js"/>
<th:block th:include="include :: bootstrap-select-js"/>
<script type="text/javascript">
    var selections = []
    var now = getNow();
    watermark({"watermark_txt": "A B C X Y Z " + now});

    $(document).ready(function () {
        initUserTable();
        $('.summernote').summernote({
            lang: 'zh-CN',
            height: 200,
        });

        $("#form-user-add").validate();

        function initUserTable() {
            $("#bootstrap-table").bootstrapTable({
                toolbar: '#toolbar',
                showToggle: true,//是否切换显示
                showColumns: true,//是否显示列，
                showColumnsToggleAll: true,
                detailView: true,//和下面的属性成对设置，是否显示加号显示详细信息
                detailFormatter: "detailFormatter",
                showExport: true,//是否导出
                // showPaginationSwitch: true,//切换是否分页显示
                showFooter: true,//是否显示页脚，主要用途是显示汇总的信息
                striped: false,//是否显示行间隔色
                paginationPreText: '上一页',
                paginationNextText: '下一页',
                queryParamsType: '',
                method: 'GET',
                uniqueId: "id",
                // height: $(window).height() - 120,

                pageNumber: 1,
                pagination: true,//是否分页
                sidePagination: 'server',//server:服务器端分页|client：前端分页
                pageSize: 10,//单页记录数
                pageList: [10, 20, 30],//可选择单页记录数
                showRefresh: true,//刷新按钮
                queryParams: queryParams,

                url: "/nc/sysNc/getncall/",
                columns: [{
                    checkbox: true
                },
                    {
                        field: 'id',
                        title: '问题id号',
                    },
                    {
                        field: 'xh',
                        title: '问题序号'
                    },
                    {
                        field: 'mkmc',
                        title: '模块名称'
                    },
                    {
                        field: 'went',
                        title: '问题名称',
                        sortable: true,
                    },
                    {
                        field: 'yuany',
                        title: '问题原因'
                    },
                    {
                        field: 'jjbz',
                        title: '解决步骤'
                    },
                    {
                        field: 'beiz',
                        title: '备注'
                    },
                    {
                        field: 'guanjz',
                        title: '关键字'
                    },
                    {
                        field: 'isRd',
                        title: '是否热点',
                        formatter:function (value,row,index) {
                            return row.isRd == 1 ? "是" : "否";
                        }
                    },
                    {
                        field: 'isJs',
                        title: '是否技术',
                        formatter:function (value,row,index) {
                            return row.isJs == 1 ? "是" : "否";
                        }
                    },
                    {
                        field: 'mkid',
                        title: '模块id号'
                    },
                    {
                        title: '图片',
                        formatter: function(value, row, index) {
                            // 图片预览（注意：如存储在本地直接获取数据库路径，如有配置context-path需要使用ctx+路径）
                            // 如：/profile/upload/2019/08/08/3b7a839aced67397bac694d77611ce72.png
                            if(index % 2 == 0){
                                return $.table.imageView('/logo.png');
                            }else {
                                return $.table.imageView('/ruoyi.png');
                            }
                        }
                    },
                    {
                        title: '操作',
                        align: 'center',
                        formatter: function (value, row, index) {
                            // var actions = [];
                            // actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="updatetjmtk(row.id)" data-toggle="modal" data-target="#myModal5"><i class="fa fa-edit"></i>编辑</a> ');
                            // actions.push('<a class="btn btn-danger btn-xs " href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
                            // // actions.push('<a class="btn btn-info btn-xs " href="javascript:void(0)" onclick="resetPwd(\'' + row.userId + '\')"><i class="fa fa-key"></i>重置</a>');
                            // return actions.join('');
                            var id = index;
                            var data = JSON.stringify(row);
                            var result = "";
                            result += "<a href='javascript:;' class='btn btn-xs green' onclick=\"ViewById('" + id + "')\" title='查看'><span class='glyphicon glyphicon-search'></span></a>";
                            result += "<a href='javascript:;' class='btn btn-xs blue' onclick=\"EditViewById('" + row + "','" + id + "')\" title='编辑'><span class='glyphicon glyphicon-pencil'></span></a>";
                            result += "<a href='javascript:;' class='btn btn-xs red' onclick=\"DeleteByIds('" + id + "')\" title='删除'><span class='glyphicon glyphicon-remove'></span></a>";
                            return result;
                        }
                    }]
            })
        }
    });

    //查询按钮事件
    $('#search_btn').click(function () {
        if ($('#mkid').val()==null){
            alert("您好您点击了搜索按钮，此时您需要选择模块名称，您最少要选择一个，也可以全部选中");
            return false;
        }
        $('#bootstrap-table').bootstrapTable('refresh', {
            url: '/nc/sysNc/getnclist/'+$('#mkid').val(),
        });
    })

    $("#button-open-4").click(function () {
        $.modal.open('添加用户', "/form", '900', '500', callback);
    })

    function callback(index, layero) {
        alert("进入了回调函数提交方法");
        $.ajax({
            url: "/nc/sysNc/insertspkfk",
            type: 'POST',
            data: $("#form-user-add form").serialize(),
            success: function (result) {
                if (result != null) {
                    alert("添加商品成功！！！");
                }
            }
        });
    }

    function getIdSelections() {
        return $.map($('#bootstrap-table').bootstrapTable('getSelections'), function (row) {
            return row.id
        })
    }

    function getwentSelections() {
        return $.map($('#bootstrap-table').bootstrapTable('getSelections'), function (row) {
            return row.went
        })
    }

    //多个删除
    function remove() {
        var ids = getIdSelections();
        var wents = getwentSelections();
        if (confirm("确认删除【" + wents + "】吗？？？")) {
            $.ajax({
                url: "/nc/sysNc/deleteallspkfk/" + ids,
                type: 'DELETE',
                success: function (result) {
                    if (result != null) {
                        alert("删除成功！！！");
                        window.location.href = window.location.href;
                    }
                },
            });
        }
    }

    function responseHandler(res) {

        $.each(res.rows, function (i, row) {
            row.state = $.inArray(row.id, selections) !== -1
        })
        return res

    }

    function queryParams(params) {
        var param = {
            limit: params.limit, // 页面大小
            offset: params.offset, // 页码
            nextPage: params.pageNumber,
            pageNumber: params.pageNumber,
            pageSize: params.pageSize,
            went:$('#went').val(),
        };
        return param;
    }

    function detailFormatter(index, row) {
        var html = []
        $.each(row, function (key, value) {
            html.push('<p><b>' + key + ':</b> ' + value + '</p>')
        })
        return html.join('')
    }

</script>
</body>
</html>